<%--
  Created by IntelliJ IDEA.
  User: Y
  Date: 2017/8/28
  Time: 17:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>test</title>
    <script type="text/javascript" src="/resources/general/js/lib/jquery.min.js"></script>
</head>
<body>

<br>
<button id="testGetList" onclick="getList()">testGetList</button>
<br>
<button id="testSearch" onclick="searchUser()">testSearch</button>
<br>
<button id="testShareDelete" onclick="shareDelete()">testShareDelete</button>
<br>
<button id="testRankDay" onclick="rankDay()">testRankDay</button>

<br>
<div id="answer">

</div>

<script type="text/javascript">
    function getList() {
        var data={"pageNum":1,"pageSize":3,"orderByField":"createTime","userId":3,"isAscend":false};
        $.ajax({
            type:"POST",
            url:"/share/getPublicList",
            dataType:"json",
            contentType:"application/json",
            data:JSON.stringify(data),
            success:function(data){
                $("#answer").html(data);
            }
        });
    }

    function searchUser() {
        var data={"pageNum":1,"pageSize":3,"q":"陈","userId":3};
        $.ajax({
            type:"POST",
            url:"/search/user",
            dataType:"json",
            contentType:"application/json",
            data:JSON.stringify(data),
            success:function(data){
                $("#answer").html(data);
            }
        });
    }

    function shareDelete() {
        var data={"commentId":31};
        $.ajax({
            type:"POST",
            url:"/share/delete",
            dataType:"json",
//            contentType:"application/json",
            data:
            data,
//                JSON.stringify(data),
            success:function(data){
                $("#answer").html(data);
            }
        });
    }

    function rankDay() {
        var data={"userId":5};
        $.ajax({
            type:"POST",
            url:"/rank/week",
            dataType:"json",
//            contentType:"application/json",
            data:
            data,
//                JSON.stringify(data),
            success:function(data){
                $("#answer").html(data);
            }
        });
    }
</script>
</body>
</html>
